import request from '@/utils/request'

export function getAll(params) {
  return request({
    url: '/bloodApply',
    method: 'get',
    params,
  })
}

export function getOne(id, params) {
  return request({
    url: '/bloodApply/' + id,
    method: 'get',
    params,
  })
}

export function addOne(data) {
  return request({
    url: '/bloodApply',
    method: 'post',
    data,
  })
}

export function updateOne(id, data) {
  return request({
    url: '/bloodApply/' + id,
    method: 'patch',
    data,
  })
}

export function deleteOne(id) {
  return request({
    url: '/bloodApply/' + id,
    method: 'delete',
  })
}

export function acceptOne(apply_num, data) {
  return request({
    url: '/bloodApply/accept/' + apply_num,
    method: 'post',
    data,
  })
}

export function verifyOne(apply_num, data) {
  return request({
    url: '/bloodApply/verify/' + apply_num,
    method: 'post',
    data,
  })
}

export function invalidOne(apply_num, data) {
  return request({
    url: '/bloodApply/invalid/' + apply_num,
    method: 'post',
    data,
  })
}

export function specimenOne(apply_num, data) {
  return request({
    url: '/bloodApply/specimen/' + apply_num,
    method: 'post',
    data,
  })
}

export function sendOne(apply_num, data) {
  return request({
    url: '/bloodApply/send/' + apply_num,
    method: 'post',
    data,
  })
}

export function monitorOne(id) {
  return request({
    url: `/bloodApply/${id}/monitor`,
    method: 'get',
  })
}

export function censusOne(id) {
  return request({
    url: `/bloodApply/${id}/census`,
    method: 'get',
  })
}
